package day03;
//运算符的演示
public class OperDemo {
    public static void main(String[] args) {

        /*
        int num = 0;//(代数5、0)
        int flag = num>0?2:-2;
        System.out.println(flag);//2/-2

        int a = 50 ,b=5;//(代数5/55；50/5)
        int max = a>b?a:b;
        System.out.println("max的最大值是:"+max);//55/50

         */

        /*
        System.out.println(10+20+""+30);//3030
        System.out.println(""+10+20+30);//102030
        System.out.println(10+20+30+"");//60
        System.out.println(10+30+""+1010);//401010

         */

        /*
        int age = 33;
        System.out.println("age");
        System.out.println(age);
        System.out.println("age="+age);
        System.out.println("我今年"+age+"岁了!");
        String name = "刘顺国";
        System.out.println("大家好，我叫"+name+"。今年"+age+"岁了!");//大家好，我叫刘顺国，今年33岁了
        String address = "济南市历城区君授路588号中海华山珑城C区8号楼!";
        System.out.println("大家好，我叫"+name+"。今年"+age+"岁了。家住"+address);

         */

        /*
        int a=5;
        System.out.println(a);//5
        a +=10;
        System.out.println(a);//15
        a -=5;
        System.out.println(a);//10
        a *=2;
        System.out.println(a);//20
        a %=1;
        System.out.println(a);//0

        short b =5;
        b = (short)(b+10);//编译错误，s为short类型，但赋值号后面的值为int类型，所以需要强转。
        b +=10;//赋值号自带强转功能，强转之后为 b = (short)(b+10)
        System.out.println(b);//25

         */

        /*
        int a = 5,b = 10,c = 5;
        boolean b1 = !(a>b ||c<b);//!(false || true)
        System.out.println(b1);//false
        System.out.println(!(a<b || c>b));//!(true ||false)=false

        boolean b2= a>b && c++>2;
        System.out.println(b2);
        System.out.println(c);

        boolean b3=a<b ||c++>2;
        System.out.println(b3);
        System.out.println(c);

         */

        /*
        boolean b1 = a>b ||c<b;
        System.out.println(b1);//false ||true = true
        System.out.println(b>a ||c>b);//true || false = true
        System.out.println(a>c ||c<a);//false || false = false
        System.out.println(a==c || b>c);//true ||true = true
        int score = 90;
        System.out.println(score<0 ||score>100);//成绩不合法验证
        */
        /*
        boolean b1 = b>a && b<c;
        System.out.println(b1);//false
        System.out.println(a>b && c<b);//false
        System.out.println(b>a && a<=c);//true

        int age =38;
        System.out.println(age>=20 && age<=40);//true
        int score =90;
        System.out.println(score>=80 && score<=100);//true

         */

        /*
        int a =5,b=10,c=5;
        boolean b1 =a>b;
        System.out.println(b1);
        System.out.println(b>a);
        System.out.println(c<b);
        System.out.println(a==c);
        System.out.println(a!=c);
        System.out.println(a%2==0);
        System.out.println(a+c>b);

         */

        /*
        无论在前在后，只要被使用了，++自增一，--自减一。
        单独使用指的是只有a++，++a,--a,a--.输出也算被使用。
        int a =5,b=5;
        a++;
        ++b;
        System.out.println(a);//6
        System.out.println(b);//6

        int c =5,d=5;
        int e = c++;
        int f =++d;
        System.out.println(c);//
        System.out.println(d);//
        System.out.println(e);//
        System.out.println(f);//

        int c =5,d=5;
        int e = c--;
        int f =--d;
        System.out.println(c);//
        System.out.println(d);//
        System.out.println(e);//
        System.out.println(f);//

         */
    }
}
